{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "d0e6b379",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "from sklearn.datasets import load_iris\n",
    "import warnings\n",
    "sns.set(style='darkgrid',font_scale=1.2)#font_scale总体字号大小\n",
    "# 设置中文字体\n",
    "plt.rcParams['font.family']=['sans-serif']\n",
    "plt.rcParams['font.sans-serif']='SimHei'\n",
    "# 忽略警告\n",
    "warnings.filterwarnings('ignore')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ac7e9853",
   "metadata": {},
   "source": [
    "#### 点估计，就是使用样本的统计量去代替总体参数。例如，我们要求鸢尾花的平均花瓣长度，就可以使用\n",
    "样本的均值来估计总体的均值。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "2ae14dab",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.7580000000000005"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris=load_iris()\n",
    "# 将鸢尾花数据与类别进行拼接，因为类别只有150个数据，为鸢尾花是个二维数据结构，先试用reshape更改结构\n",
    "data=np.concatenate([iris.data,iris.target.reshape(-1,1)],axis=1)\n",
    "# 将data数据转化为dataframe格式\n",
    "data=pd.DataFrame(\n",
    "    data,\n",
    "    columns=['sepal_length','sepal_width','petal_length','petal_width','type']\n",
    ")\n",
    "# 求鸢尾花平均花瓣长度\n",
    "a=data['petal_length'].mean()\n",
    "a"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dfb5b7f8",
   "metadata": {},
   "source": [
    "#### 数据的分布状态"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b7abd17b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f96351a9",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "24811105",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9f9d76df",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e3599537",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
